home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
program
/
gcc
/
libmat.lha
/
src
/
mplus.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1980-01-01
|
447b
|
26 lines
// MATRIX LIB
// TOMMY JOHANSSON 1995
#include "matrix.h"
Matrix operator + (const Matrix& A,const Matrix& B)
{
int i,j;
#ifdef DEBUG
puts("Adderar matris.");
#endif
#ifdef CHECK
if((A.m!=B.m)&&(A.n!=B.n))
{
printf("Felaktiga dimensioner %d<>%d eller %d<>%d!\n",A.m,B.m,A.n,B.n);
exit(0);
}
#endif
Matrix C(A.m,A.n);
for(i=1;i<=A.m;i++)
for(j=1;j<=A.n;j++)
C.koff[i][j]=A.koff[i][j]+B.koff[i][j];
return(C);
}